#include "ChargeMoney.h"
#include"BoyStudent.h"
#include"GirlStudent.h"
#include<iostream>
using namespace std;
ChargeMoney::ChargeMoney(int nMoney) : m_nTotalMoney(nMoney)
{
}


ChargeMoney::~ChargeMoney(void)
{
}

void ChargeMoney::Visitor(BoyStudent *pStu)
{
	int nMoneyToPay = 2 * PAY;
	pStu->Pay(nMoneyToPay);
	this->m_nTotalMoney += nMoneyToPay;
	cout<<pStu->GetName()<<" is charged "<<nMoneyToPay<<endl;
	cout<<"Sum Money is "<<m_nTotalMoney<<endl;
}

void ChargeMoney::Visitor(GirlStudent *pStu)
{
	int nMoneyToPay = PAY;
	pStu->Pay(nMoneyToPay);
	this->m_nTotalMoney += nMoneyToPay;
	cout<<pStu->GetName()<<" is charged "<<nMoneyToPay<<endl;
	cout<<"Sum Money is "<<m_nTotalMoney<<endl;
}
